﻿using AnesSystem.ViewModels;
using AnesSystem.ViewModels.LaborAnalgesia;
using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.CQ.CQFY
{
    /// <summary>
    /// LaborAnalgesiaCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class LaborAnalgesiaCtrl : BaseTableControl
    {
        public LaborAnalgesiaCtrl()
        {
            InitializeComponent();
            this.Loaded += LaborAnalgesiaCtrl_Loaded;
        }

        public override void InvokePrePrint()
        {
            CancelButton();
        }

        public override void InvokeOverPrint()
        {
            AddButton();
        }

        private void CancelButton()
        {
            (_vitalCtrl.DataContext as LaborRealTimeItemCtrlViewModel).IsPrint = Visibility.Collapsed;
            (_EventCtrl.DataContext as LaborEventAndMedicineCtrlViewModel).IsPrint = Visibility.Collapsed;
        }
        private void AddButton()
        {
            (_vitalCtrl.DataContext as LaborRealTimeItemCtrlViewModel).IsPrint = Visibility.Visible;
            (_EventCtrl.DataContext as LaborEventAndMedicineCtrlViewModel).IsPrint = Visibility.Visible;
        }



        /// <summary>
        /// 分娩镇痛单刷新
        /// </summary>
        public override void Refesh()
        {
            LaborAnalgesiaProcessViewModel.Instance.GotoLaborCtrl();
        }
        private void LaborAnalgesiaCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            FunctionListHeaderCtrlViewModel.Instance.DisplayButton(true, FunctionListButton.镇痛模板, FunctionListButton.存储模板, FunctionListButton.刷新, FunctionListButton.打印);
            DataManager.Instance.IsInAorP = Constants.ISLABOR;
        }

    }
}
